package managedbeans.view.beans;

import javax.faces.event.ValueChangeEvent;

import oracle.adf.view.rich.component.rich.input.RichInputText;

public class backing_ManagedBeanTest {
    private RichInputText phoneNumber;

    public backing_ManagedBeanTest() {
    }
/**
     *This method gets fire on changing value in Email field.
     * If the value in Email field is "NOEMAIL" , the phonenumber field is made 
     * disabled.
     * PPR is done by autosubmit property of email as true and partial trigger of
     * phonenumber reffers to email input text.
     * @param valueChangeEvent
     */
    public void valueChangeEmail(ValueChangeEvent valueChangeEvent) {
        // Add event code here...
        getPhoneNumber().setDisabled(false);
        if(valueChangeEvent.getNewValue().equals("NOEMAIL")) {
            getPhoneNumber().setDisabled(true);
        }
    }

    public void setPhoneNumber(RichInputText phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public RichInputText getPhoneNumber() {
        return phoneNumber;
    }
}
